package com.serviceImpl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.bean.ProductionPlan;
import com.mapper.ProductionPlanMapper;
import com.service.ProductionPlanService;

/**
 * @author author : 张鹏
 * @date createTime：2018年1月19日 下午5:42:44
 * @Description: 该类的功能描述
 */
@Service
public class ProductionPlanServiceImpl implements ProductionPlanService {
	@Resource
	private ProductionPlanMapper planMapper;

	@Override
	public List<ProductionPlan> selectAll() {
		// TODO Auto-generated method stub
		return planMapper.selectAll();
	}

	@Override
	public ProductionPlan selectByPrimaryKey(int productionPlanId) {
		// TODO Auto-generated method stub
		return planMapper.selectByPrimaryKey(productionPlanId);
	}
	
	
	@Override
	public List<ProductionPlan> selectAllGroupByDayProductTime() {
		// TODO Auto-generated method stub
		return planMapper.selectAllGroupByDayProductTime();
	}
	@Override
	public List<ProductionPlan> selectAllGroupByMonthProductTime() {
		// TODO Auto-generated method stub
		return planMapper.selectAllGroupByMonthProductTime();
	}
	@Override
	public List<ProductionPlan> selectAllGroupByYearProductTime() {
		// TODO Auto-generated method stub
		return planMapper.selectAllGroupByYearProductTime();
	}

	@Override
	public int createNewPlan(ProductionPlan plan) {
		// TODO Auto-generated method stub
		return planMapper.insert(plan);
	}

	@Override
	public int updatePlan(ProductionPlan plan) {
		// TODO Auto-generated method stub
		return planMapper.updateByPrimaryKey(plan);
	}
	
	@Override
	public int deleteProductionPlan(int productionPlanId) {
		// TODO Auto-generated method stub
		return planMapper.deleteProductionPlan(productionPlanId);
	}

	@Override
	public int deletePlanByPrimaryKey(int productionPlanId) {
		// TODO Auto-generated method stub
		return planMapper.deleteByPrimaryKey(productionPlanId);
	}

	@Override
	public List<ProductionPlan> selectByState(int state) {
		return planMapper.selectByState(state);
	}

}
